package com.pig4cloud.pig.upload.util;

public class FileUtil {

	public static final int TYPE_USER_PHOTOS = 0;//用户头像
	public static final int TYPE_EVENT_IMGS = 1;// 事件图片
	public static final int TYPE_WORKLOG_IMGS = 2;// 工作日志图片
	public static final int TYPE_ARTICLE_IMGS = 3;// 文章新闻
	public static final int TYPE_EARTHQUAKE_IMGS = 4;// 地震相关图片
	public static final int TYPE_BANNER_IMGS = 5;// 轮播图相关图片
	public static final int TYPE_APP_VERSION = 99;// app安装包
	public static final int TYPE_DEPT_LOGO = 6;
	public static final int TYPE_VISIT = 8;//走访慰问
	public static final int TYPE_POLICE = 9;//走访慰问
	public static final int TYPE_FIRE = 10;//智慧消防

	private static final String USER_PHOTOS_PREFIX = "user/photos/";
	private static final String EVENT_IMGS = "event/";
	private static final String WORKLOG_IMGS = "worklog/";
	private static final String ARTICLE_IMGS = "article/";
	private static final String EARTHQUAKE_VERSION = "earthquake/";
	private static final String BANNER_IMGS = "banner/";
	private static final String APP_VERSION = "appversion/";
	private static final String DEPT_LOGO = "dept/logo/";
	private static final String VISIT_PREFIX = "visit/";
	private static final String POLICE_PREFIX = "police/";
	private static final String FIRE_PREFIX = "fire/";

	public static void main(String args[]) {
		//upload();
	}

	/**
	 * 获取  上传图片的 路径前缀
	 *
	 * @param upload_type
	 * @return
	 */
	public static String getUploadPrefix(int upload_type) {
		String prefix = null;
		switch (upload_type) {
			case TYPE_USER_PHOTOS:
				prefix = USER_PHOTOS_PREFIX;
				break;
			case TYPE_EVENT_IMGS:
				prefix = EVENT_IMGS;
				break;
			case TYPE_WORKLOG_IMGS:
				prefix = WORKLOG_IMGS;
				break;
			case TYPE_ARTICLE_IMGS:
				prefix = ARTICLE_IMGS;
				break;
			case TYPE_APP_VERSION:
				prefix = APP_VERSION;
				break;
			case TYPE_BANNER_IMGS:
				prefix = BANNER_IMGS;
				break;
			case TYPE_EARTHQUAKE_IMGS:
				prefix = EARTHQUAKE_VERSION;
				break;
			case TYPE_DEPT_LOGO:
				prefix = DEPT_LOGO;
				break;
			case TYPE_VISIT:
				prefix = VISIT_PREFIX;
				break;
			case TYPE_POLICE:
				prefix = POLICE_PREFIX;
				break;
			case TYPE_FIRE:
				prefix = FIRE_PREFIX;
				break;

		}
		return prefix;
	}
}
